public class ThreeConsecutiveOddNumbers {
    public static void main(String[] args) {
        int []arr1={1,1,2,2,3};
        int []arr2={5,5,5,2,5};
        int []arr3={1,2,3,3,3};
        System.out.println(threeConsecutiveOddNumbers(arr1));
        System.out.println(threeConsecutiveOddNumbers(arr2));
        System.out.println(threeConsecutiveOddNumbers(arr3));
    }

    public static boolean threeConsecutiveOddNumbers(int[]array){
        int flag=0;
        int i=0;
        while(flag<3&&i<array.length){
            if(array[i]%2==0){
                flag=0;
                i++;
                continue;
            }
            else {
                flag++;
                i++;
            }
        }
        if(flag>=3){
            return true;
        }

            return false;

        }
    }

